
import java.io.Serializable;
import java.rmi.RemoteException;

/**
 *
 * @author anderzanic
 */
public class AguardarPalavra extends Thread implements Serializable{
    
    @Override
    public void run() {
        try {
            int i = 0;
            while(Start.getServicoRemoto().getJogo().getPalavra() == null) {
                System.out.println("Palavra: "+Start.getServicoRemoto().getJogo().getPalavra());
                System.out.println("Aguardando palavra..." + i++);
                sleep(5000);
            }
            
            Forca forca = new Forca();
            forca.inicia();
        } catch (RemoteException | InterruptedException ex) {
            System.out.println("Erro ao consultar palavra dentr da thread...");
        }
    }
}
